package com.mofeng.myshop.domain.dto.search;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mofeng.myshop.domain.dto.base.SearchBaseMp;
import com.mofeng.myshop.domain.po.Address;
import com.mofeng.myshop.domain.po.AddressMap;
import com.mofeng.myshop.until.MyUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Builder(toBuilder = true)
public class AddressMapSearchDto extends SearchBaseMp {

    @Schema(description = "项目ID")
    private Long projectId;

    @Schema(description = "端口")
    private Integer port;

    @Schema(description = "地图类型  0 PVE   1 PVP")
    private String mapType;

    public void setProjectId(String projectId) {
        this.projectId = MyUtil.NumberUtil.asLong(projectId);
    }

    public void setPort(String port) {
        this.port = MyUtil.NumberUtil.asInt(port);
    }

    public void setMapType(String mapType) {
        this.mapType = webNullHandle(mapType);
    }

    public Page<AddressMap> getPageMp() {
        return super.getPageMp(AddressMap.class);
    }
}
